<template>
  
    <el-container class="Layout-container-top" style="height: 100px;width: 1500px;">
      <el-header class="head">
        欢迎您！{{ username }}用户！
      </el-header>
    </el-container>
    <el-container class="layout-container-main" style="width: 1500px;height: 3000px;">
      <el-aside width="200px" height="100px">
        <el-scrollbar>
          <el-menu :default-openeds="['1', '3']">
            <el-sub-menu v-show="Number.parseInt(deptId) == 138 || Number.parseInt(deptId) == 140" index="1">
              <template #title>
                <el-icon><message /></el-icon>挂号收费
              </template>
                <el-menu-item   index="1-1" @click="goToOrder()">
                  <template #title>
                  窗口挂号
                </template>
                </el-menu-item>
                <el-menu-item index="1-2" @click="goToNoOrder()">
                  <template #title>
                  窗口退号
                </template>
                </el-menu-item>
                <el-menu-item index="1-3" @click="goToPay()">
                  <template #title>
                  收费
                </template>
                </el-menu-item>
                <el-sub-menu index="1-4" @click="goToNoPay()">
                <template #title>
                  退费
                </template>
              </el-sub-menu>
              <el-sub-menu index="1-5" @click="goToPayMemory()" >
                <template #title>
                  费用记录查询
                </template>
              </el-sub-menu>
            </el-sub-menu>
            <el-sub-menu index="2" v-show="Number(deptId) == 140 || (Number(deptId) != 138 && Number(deptId) != 134 && Number(deptId) != 126 && Number(deptId) != 119 && Number(deptId) != 118)"
            >
              <template #title>
                <el-icon><icon-menu /></el-icon>医生工作
              </template>
                <el-menu-item index="2-1" @click="goToLookPatient()">患者查看</el-menu-item>
                <el-menu-item index="2-2" @click="goToBookIndex()">医生诊疗</el-menu-item>
                <el-menu-item index="2-3" @click="goToDoctorMemory()">看诊记录</el-menu-item>
            </el-sub-menu>
            <el-sub-menu index="3" v-show="Number.parseInt(deptId) == 134 || Number.parseInt(deptId) == 140">
              <template #title>
                <el-icon><setting /></el-icon>检查管理
              </template>
                <el-menu-item index="3-1" @click="goToCheckRequestNormal()">检查申请</el-menu-item>
                <el-menu-item index="3-2" @click="goToCheckIn()">患者录入</el-menu-item>
                <el-menu-item index="3-3" @click="goToCheckNormal()">检查录入</el-menu-item>
                <el-menu-item index="3-4" @click="goToCheckManage()">检查管理</el-menu-item>
            </el-sub-menu>
            <el-sub-menu index="4" v-show="Number.parseInt(deptId) == 126 || Number.parseInt(deptId) == 140">
              <template #title>
                <el-icon><icon-menu /></el-icon>检验管理
              </template>
                <el-menu-item index="4-1" @click="goToInspectionRequest()">检验申请</el-menu-item>
                <el-menu-item index="4-2" @click="goToInspectionionPatient()">患者录入</el-menu-item>
                <el-menu-item index="4-3" @click="goToInspectionion()">检验录入</el-menu-item>
                <el-menu-item index="4-4" @click="goToInspectionManage()">检验管理</el-menu-item>
            </el-sub-menu>
            <el-sub-menu index="5" v-show="Number.parseInt(deptId)==139||Number.parseInt(deptId)==140">
              <template #title>
                <el-icon><icon-menu /></el-icon>药房管理
              </template>
                <el-menu-item index="5-1" @click="goToMedicine()">药房发药</el-menu-item>
                <el-menu-item index="5-2" @click="goToNoMedicine()">药房退药</el-menu-item>
                <el-menu-item index="5-3" @click="goToMedicineManage()">药库管理</el-menu-item>
                <el-menu-item index="5-4" @click="goToMedicineMemory()">发烧药记录管理</el-menu-item>
            </el-sub-menu>
            <el-sub-menu index="6" v-show="Number.parseInt(deptId)==118||Number.parseInt(deptId)==140">
              <template #title>
                <el-icon><icon-menu /></el-icon>处置管理
              </template>
                <el-menu-item index="6-1" @click="goToDisposalRequest()">处置申请</el-menu-item>
                <el-menu-item index="6-2" @click="goToDisposalPatient()">患者录入</el-menu-item>
                <el-menu-item index="6-3" @click="goToDisposal()">处置录入</el-menu-item>
                <el-menu-item index="6-4" @click="goToDisposalManage()">处置管理</el-menu-item>
            </el-sub-menu>
          </el-menu>
        </el-scrollbar>
      </el-aside>
  
      <el-container>
       
       
        <el-main style="background-color: #F0F2F5;">
       

         <RouterView/>
      
        </el-main>
      </el-container>
    </el-container>
  </template>
  
  <script lang="ts" setup>
import router from '@/router/index';
import { Menu as IconMenu, Message, Setting } from '@element-plus/icons-vue'
import { RouterView } from 'vue-router';
import { userLoginStorage } from '@/stores/userloginStorage';
const storage=userLoginStorage();
const username=sessionStorage.getItem('realName');
const deptId=sessionStorage.getItem('deptId');
 function goToOrder() {
    router.push({ name: 'order' });
  }
  function goToPay() {
    router.push({ name: 'pay' });
  }
  function goToNoOrder() {
    router.push({ name: 'noOrder' });
  }
  function goToNoPay() {
    router.push({ name: 'noPay' });
  }
  function  goToLookPatient() {
    router.push({ name: 'lookPatient' });
  }
 
  function  goToBookIndex() {
    router.push({ name: 'bookIndex' });
  }
  
  function goToDoctorMemory() {
    router.push({ name: 'doctorMemory' });
  }
 
function goToPayMemory() {
    router.push({ name: 'payMemory' });
  }
  function goToCheckRequestNormal() {
    router.push({ name: 'checkRequestNormal' });
  }
  function goToCheckIn() {
    router.push({ name: 'checkIn' });
  }
  function goToCheckNormal() {
    router.push({ name: 'checkNormal' });
  }
  function goToCheckManage() {
    router.push({ name: 'checkManage' });
  }
  function goToInspectionRequest() {
    router.push({ name: 'inspectionRequest' });
  }
  function goToInspectionionPatient() {
    router.push({ name: 'inspectionPatient' });
  }
  function goToInspectionion() {
    router.push({ name: 'inspection' });
  }
  function goToInspectionManage() {
    router.push({ name: 'inspectionManage' });
  }
  function goToMedicine() {
    router.push({ name:'medicine' });
  }
  function goToNoMedicine() {
    router.push({ name: 'noMedicine' });
  }
  function goToMedicineManage() {
    router.push({ name:'medicineManage' });
  }
  function goToMedicineMemory() {
    router.push({ name:'medicineMemory' });
  }
  function goToDisposalRequest() {
    router.push({ name: 'disposalRequest' });
  }
  function goToDisposalPatient() {
    router.push({ name: 'disposalPatient' });
  }
  function goToDisposal() {
    router.push({ name: 'disposal' });
  }
  function goToDisposalManage() {
    router.push({ name: 'disposalManage' });
  }
  </script>
  
 
  <style scoped>
   .Layout-container-top{
    background-color: aliceblue;
   }
   .Layout-container-top el-header {
    position: relative;
    background-color: var(--el-color-primary-light-3);
    color: var(--el-text-color-primary);
  }
  .layout-container-main .el-aside {
    color: var(--el-text-color-primary);
   
    background-color: #CCCCCC;
  }
  .layout-container-main .el-menu .el-menu-item:hover {
    background-color: #CCCCCC;
    border-right: none;
  }
  .layout-container-main .el-menu   {
    background-color: #CCCCCC;
    border-right: none;
  }
  .layout-container-main .el-main {
 
    padding: 0;
    background-color: white;
  }
  .layout-container-main .toolbar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--el-color-primary-light-3);
  
    right: 20px;
  }
  .layout-container-main{
    background-color: var(--el-color-primary-light-7);

    height: 100vh;
  }
 
  </style>
  